import dynamic from "dva/dynamic";
import { EnterpriseHomePage } from "./enterpriseHomePage";
import { EnterpriseAddressBook } from "./enterpriseAddressBook";
import { EnterpriseManagement } from "./enterpriseManagement";
import { PersonnelRecruitment } from "./personnelRecruitment";
import { MessageNotification } from "./messageNotification";
import { Administrative } from "./administrative";
/* import { hrManagement } from "./hrManagement";
 */ import { TaskManager } from "./taskManager";
import { DevicesManagement } from "./DevicesManagement";
import { ContractManagement } from "./ContractManagement";
/* import { IncentiveManagement } from "./IncentiveManagement";
 */ import { AttendanceManagement } from "./AttendanceManagement";
import { ExaminationApproval } from "./ExaminationApproval";
import { TrainingUnitsTrainingManagement } from "./TrainingUnitsTrainingManagement";
import { TrainingInstitutionsCoursewareManagement } from "./TrainingInstitutionsCoursewareManagement";
import { TrainingInstitutionsTrainingManagement } from "./TrainingInstitutionsTrainingManagement";
import { InsuranceManagement } from "./InsuranceManagement";
import { HelpCenterFunctionIntroduction } from "./HelpCenterFunctionIntroduction";
import { HelpCenterCommonProblems } from "./HelpCenterCommonProblems";
import { HelpCenterOperationManual } from "./HelpCenterOperationManual";
import { HelpCenterPersonnelImport } from "./HelpCenterPersonnelImport";
import { HelpCenterDownloadClient } from "./HelpCenterDownloadClient";
import { HelpCenterGiveUsAdvice } from "./HelpCenterGiveUsAdvice";
// wrapper of dynamic
const dynamicWrapper = (app, models, component) =>
  dynamic({
    app,
    models: () => models.map(m => import(`../models/${m}.js`)),
    component
  });

// nav data
export const getNavData = app => [
  {
    component: dynamicWrapper(app, ["user", "login"], () =>
      import("../layouts/BasicLayout")
    ),
    layout: "BasicLayout",
    name: "首页", // for breadcrumb
    path: "/",
    children: [
      /**
       * @author Orm
       * 企业模块-企业首页
       */
      EnterpriseHomePage(app),

      /**
       * @author Orm
       * 企业模块-企业通讯录
       */
      EnterpriseAddressBook(app),

      /**
       * @author Lmb
       * 企业模块-企业管理
       */
      EnterpriseManagement(app),

      /**
       * @author Orm
       * 人事模块-人事招聘
       */
      PersonnelRecruitment(app),
      /**
       * @author Hjj
       * 人事模块-考勤管理
       * @author Lmb
       * 人事模块-医社保管理
       *  @author cxl
       * 人事模块-奖惩管理
       */
      AttendanceManagement(app),

      /**
       * @author  Lmb
       * 行政模块-消息
       */
      MessageNotification(app),
      /**
       * @author  Hjj
       * 行政模块-审批管理
       */
      ExaminationApproval(app),
      /**
       * @author  Xyz
       * 行政模块-劳务薪酬
       */
      Administrative(app),

      /**
       * @author cxl
       * 行政模块-设备管理
       */
      DevicesManagement(app),
      /**
       * @author cxl
       * 行政模块-合同管理
       */
      ContractManagement(app),

      /**
       * @author Lmb
       * 人事模块-医社保管理
      hrManagement(app),
      */
      /**
       * @author cxl
       * 人事模块-奖惩管理
      IncentiveManagement(app),
      */
      /**
       * @author Hjj
       * 业务模块-任务管理-创建任务-任务详情
       */
      TaskManager(app),
      /**
       * @author Orm
       * 培训模块-参训单位-培训管理
       */
      TrainingUnitsTrainingManagement(app),
      /**
       * @author Orm
       * 培训模块-培训机构-课件库管理
       */
      TrainingInstitutionsCoursewareManagement(app),
      /**
       * @author Orm
       * 培训模块-培训机构-培训管理
       */
      TrainingInstitutionsTrainingManagement(app),
      /**
       * @author Zjp
       * 金融保险模块-保险
       */
      InsuranceManagement(app),
      /**
       * @author Zhx
       * SaaS帮助模块-功能简介
       */
      HelpCenterFunctionIntroduction(app),
      /**
       * @author Zhx
       * SaaS帮助模块-常见问题
       */
      HelpCenterCommonProblems(app),
      /**
       * @author Zhx
       * SaaS帮助模块-操作手册
       */
      HelpCenterOperationManual(app),
      /**
       * @author Zhx
       * SaaS帮助模块-人员导入指南
       */
      HelpCenterPersonnelImport(app),
      /**
       * @author Zhx
       * SaaS帮助模块-下载客户端
       */
      HelpCenterDownloadClient(app),
      /**
       * @author Zhx
       * SaaS帮助模块-给我们建议
       */

      HelpCenterGiveUsAdvice(app),

      {
        name: "异常",
        path: "exception",
        icon: "warning",
        children: [
          {
            name: "403",
            path: "403",
            component: dynamicWrapper(app, [], () =>
              import("../routes/Exception/403")
            )
          },
          {
            name: "404",
            path: "404",
            component: dynamicWrapper(app, [], () =>
              import("../routes/Exception/404")
            )
          },
          {
            name: "500",
            path: "500",
            component: dynamicWrapper(app, [], () =>
              import("../routes/Exception/500")
            )
          }
        ]
      }
    ]
  },
  {
    component: dynamicWrapper(app, [], () => import("../layouts/UserLayout")),
    path: "/user",
    layout: "UserLayout",
    children: [
      {
        name: "帐户",
        icon: "user",
        path: "user",
        children: [
          {
            name: "登录",
            path: "LogOn",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/LogOn")
            )
          },
          {
            name: "注册",
            path: "Enroll",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/Enroll")
            )
          },
          {
            name: "个人注册",
            path: "PersonalRegistration",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/PersonalRegistration")
            )
          },
          {
            name: "个人注册成功",
            path: "PersonalRegistrationResult",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/PersonalRegistrationResult")
            )
          },
          {
            name: "企业注册",
            path: "EnterpriseRegistration",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/EnterpriseRegistration")
            )
          },
          {
            name: "企业注册成功",
            path: "EnterpriseRegistrationResult",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/EnterpriseRegistrationResult")
            )
          },
          {
            name: "企业忘记密码",
            path: "ForgetPassword",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/ForgetPassword")
            )
          },
          {
            name: "修改密码",
            path: "ChangeUserPassword",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/ChangeUserPassword")
            )
          },
          {
            name: "用户协议",
            path: "UserAgreement",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/UserAgreement")
            )
          },
          {
            name: "隐私策略",
            path: "UserPlicy",
            component: dynamicWrapper(app, ["register"], () =>
              import("../routes/User/UserPlicy")
            )
          }
        ]
      }
    ]
  }
];
